#include "SMPPQuerySM.hpp"

using namespace smpp::pdu;

QuerySM::QuerySM(const Header &nHeader,
const CoctetString &nMessageId,
const quint8 nSourceAddrTON,
const quint8 nSourceAddrNPI,
const CoctetString &nSourceAddr):
Header(nHeader),
_MessageId(nMessageId),
_SourceAddrTON(nSourceAddrTON),
_SourceAddrNPI(nSourceAddrNPI),
_SourceAddr(nSourceAddr){}

QuerySM::QuerySM(const QuerySM &nQuerySM):
Header(nQuerySM),
_MessageId(nQuerySM.getMessageId()),
_SourceAddrTON(nQuerySM.getSourceAddrTON()),
_SourceAddrNPI(nQuerySM.getSourceAddrNPI()),
_SourceAddr(nQuerySM.getSourceAddr()){}

void QuerySM::setMessageId(const CoctetString &nMessageId){
	_MessageId = nMessageId;
}

const CoctetString &QuerySM::getMessageId() const{
	return _MessageId;
}

void QuerySM::setSourceAddrTON(const quint8 nSourceAddrTON){
	_SourceAddrTON = nSourceAddrTON;
}

const quint8 QuerySM::getSourceAddrTON() const{
	return _SourceAddrTON;
}

void QuerySM::setSourceAddrNPI(const quint8 nSourceAddrNPI){
	_SourceAddrNPI = nSourceAddrNPI;
}

const quint8 QuerySM::getSourceAddrNPI() const{
	return _SourceAddrNPI;
}

void QuerySM::setSourceAddr(const CoctetString &sSourceAddr){
	_SourceAddr = sSourceAddr;
}

const CoctetString &QuerySM::getSourceAddr() const{
	return _SourceAddr;
}

void QuerySM::calcCommandLength(){
	_CommandLength = 18 + _MessageId.size() + _SourceAddr.size();
}
